GBML manual / Rooms

room_height_of

The height, in pixels, of any room in the project - not only the one you are in.

Syntax

room_height_of(r) -> int

Arguments

NameType
rroom

Returns

int

Description

Gives back the height, in pixels, of a room you name, even when it is not the room you are standing in. It is the up-and-down partner of room_width_of, and everything on that page applies here too, including why it exists and what it gives for something that is not a room.

Example

var middle = room_height_of(room_doc_arena) / 2;

Asks how tall room_doc_arena is and halves it, giving the y of that room's middle, counted down from its top-left corner (so its top edge is 0).

On the GBA

Same run-time read as room_width_of, for the height.

See also: room_width_ofroom_heightroom_change_extroom_top